// pages/common/web/index.js
import Toast from "@vant/weapp/toast/toast";
Page({

    /**
     * 页面的初始数据
     */
    data: {
        isShowEmpty: false,
        url: ""
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        this.setData({url: options.url || ""})
        Toast.loading({
            message: "加载中...",
            duration: 0,
        });
    },

    onLoadSuccess: function () {
        Toast.clear()
    },
    onLoadError: function () {
        Toast.fail("加载失败");
        this.setData({isShowEmpty: true})
    }
})